<template>
  <view class="points-item">
    <view class="item-left">
      <view class="item-title">{{ item.title }}</view>
      <view class="item-time">{{ item.time }}</view>
      <view class="item-desc">{{ item.desc }}</view>
    </view>
    <view class="item-right" :class="item.type">
      {{ item.points }}
    </view>
  </view>
</template>

<script setup>
defineProps({
  item: {
    type: Object,
    required: true
  }
});
</script>

<style lang="scss" scoped>
.points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30rpx 0;
  border-bottom: 1rpx solid #f5f5f5;
  
  &:last-child {
    border-bottom: none;
  }
  
  .item-left {
    flex: 1;
    
    .item-title {
      font-size: $font-size-28rpx;
      color: $text-color;
      margin-bottom: 8rpx;
    }
    
    .item-time {
      font-size: $font-size-24rpx;
      color: $text-color-666;
      margin-bottom: 8rpx;
    }
    
    .item-desc {
      font-size: $font-size-22rpx;
      color: $text-color-666;
    }
  }
  
  .item-right {
    font-size: $font-size-32rpx;
    font-weight: bold;
    
    &.add {
      color: $primary-color;
    }
    
    &.minus {
      color: #52c41a;
    }
  }
}
</style>